package web.services;

import java.util.List;
import java.util.Map;

/**
 * Created by Administrator on 2016/3/15.
 */

public interface LuceneSearchService {
    int TITLE_TYPE = 0;
    String TITLE_STR = "title";
    int CONTENT_TYPE = 1;
    String CONTENT_STR = "content";
    String CONTENT_STR_INDEX = "content_index";

    /**
     * 主页搜索lucene
     * @param num
     * @param all_search_key
     * @param search_key
     * @param un_search_key
     * @param provinceId
     * @param city
     * @param itemAmount
     * @param qualification
     * @param status
     * @param type
     * @return
     */
    List<Map<String,Object>> searchSimple(int num, String all_search_key, String search_key,
                                          String un_search_key, String provinceId, String city,
                                          Integer itemAmount, String qualification, int status, final int type
    );

    /**
     * 通过关键词搜索数据
     * @param key
     * @return
     */
    List<Map<String,Object>> search(String key);
    /**
     * 通过关键词搜索数据
     * @param key
     *  @param num 查询条数
     * @return
     */
    Map<String,Object> search(String key, String location, int type, String qualification, int num, int nowPage);

    /**
     * 通过关键词与省份搜索数据
     * @param key
     * @param location
     * @param type 0招标  1中标
     * @return
     */
    List<Map<String,Object>> search(String key, String location, int type, String qualification);

    /**
     * 不实时搜索，含有更多列数据
     * @param key
     * @param province
     * @param time
     * @return
     */
    List<Map<String,Object>> search(String key, String province, String time, int num);

    /**
     * 通过lucene打分机制获取数据得分
     * @param listNews
     * @param name
     * @return
     */
    Map<Long,Double> getScoreCompute(List<Map<String, Object>> listNews, String name);

}
